Xbasic

A5_RESOURCE_INFO Function

Syntax

Property_List as P = a5_resource_info([* process_name_or_id [,C computer ]])

Property_List as P = a5_resource_info( process_name_or_id as N )

Arguments

Property_List

A dot variable containing information about the process.

process_name_or_id

A character string or variable that contains the name of a running executable (i.e. "alpha5.exe") or a numeric variable that is the process ID of a running executable (i.e. 593).

computer

Character

Description

use WMI to find out what resources are being used by the specified process

Discussion

The A5_RESOURCE_INFO() function returns Windows resource utilization info for the specified process name or ID. If the specified Process_Name_or_ID does not match the name or ID of an executable currently being run by Windows, nothing is returned.

Example

?a5_resource_info("alpha5.exe") 
= Caption = "alpha5.exe" 
CommandLine = "C:\Program Files\A5V6\alpha5.exe" 
CreationClassName = "Win32_Process" 
CreationDate = 01/03/2005 05:50:51 00 am 
CSCreationClassName = "Win32_ComputerSystem" 
CSName = "DEVELOPMENT01" 
Description = "alpha5.exe" 
ExecutablePath = "C:\Program Files\A5V6\alpha5.exe" 
ExecutionState = 
Handle = "3700" 
HandleCount = 1715 
InstallDate = 
KernelModeTime = "391875000" 
MaximumWorkingSetSize = 1413120 
MinimumWorkingSetSize = 204800 
Name = "alpha5.exe" 
OSCreationClassName = "Win32_OperatingSystem" 
OSName = "Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddisk0\Partition1" 
OtherOperationCount = "67395" 
OtherTransferCount = "1833095" 
PageFaults = 112592 
PageFileUsage = 90849280 
ParentProcessId = 1908 
PeakPageFileUsage = 106446848 
PeakVirtualSize = "234344448" 
PeakWorkingSetSize = 99880960 
Priority = 8 
PrivatePageCount = "90849280" 
ProcessId = 3700 
QuotaNonPagedPoolUsage = 19864 
QuotaPagedPoolUsage = 124552 
QuotaPeakNonPagedPoolUsage = 24144 
QuotaPeakPagedPoolUsage = 124552 
ReadOperationCount = "40740" 
ReadTransferCount = "57793261" 
SessionId = 0 
Status = 
TerminationDate = 
ThreadCount = 12 
UserModeTime = "908593750" 
VirtualSize = "218718208" 
WindowsVersion = "5.1.2600" 
WorkingSetSize = "48857088" 
WriteOperationCount = "51052" 
WriteTransferCount = "78946262" 

?a5_resource_info(1908) 
= Caption = "explorer.exe" 
CommandLine = "C:\WINDOWS\Explorer.EXE" 
CreationClassName = "Win32_Process" 
CreationDate = 12/22/2004 04:36:01 00 pm 
CSCreationClassName = "Win32_ComputerSystem" 
CSName = "DEVELOPMENT01" 
Description = "explorer.exe" 
ExecutablePath = "C:\WINDOWS\Explorer.EXE" 
ExecutionState = 
Handle = "1908" 
HandleCount = 591 
InstallDate = 
KernelModeTime = "5247968750" 
MaximumWorkingSetSize = 1413120 
MinimumWorkingSetSize = 204800 
Name = "explorer.exe" 
OSCreationClassName = "Win32_OperatingSystem" 
OSName = "Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddisk0\Partition1" 
OtherOperationCount = "3290956" 
OtherTransferCount = "109318750" 
PageFaults = 1780078 
PageFileUsage = 23777280 
ParentProcessId = 112 
PeakPageFileUsage = 28684288 
PeakVirtualSize = "129712128" 
PeakWorkingSetSize = 34189312 
Priority = 8 
PrivatePageCount = "23777280" 
ProcessId = 1908 
QuotaNonPagedPoolUsage = 15120 
QuotaPagedPoolUsage = 93520 
QuotaPeakNonPagedPoolUsage = 20136 
QuotaPeakPagedPoolUsage = 110076 
ReadOperationCount = "1562825" 
ReadTransferCount = "133498697" 
SessionId = 0 
Status = 
TerminationDate = 
ThreadCount = 15 
UserModeTime = "2327812500" 
VirtualSize = "105119744" 
WindowsVersion = "5.1.2600" 
WorkingSetSize = "26046464" 
WriteOperationCount = "892" 
WriteTransferCount = "31692714"

Limitations

Desktop applications only.

See Also